

--oracle
CREATE SEQUENCE SEQ_cod_table_ID START WITH 1;


-- 菜单SQL
INSERT INTO sys_menu (menu_id,parent_id, name, url, perms, type, icon, order_num, plat)
    VALUES (SEQ_MENU_ID.nextval,'1', '代码生成表', 'code/codTable.html', NULL, '1', 'fa fa-file-code-o', '6','1');

-- 按钮父菜单ID
-- 需要替换 @parentId 
-- select SEQ_MENU_ID.currval from dual; 

-- 菜单对应按钮SQL
INSERT INTO sys_menu (menu_id,parent_id, name, url, perms, type, icon, order_num, plat)
    SELECT SEQ_MENU_ID.nextval, @parentId, '查看', null, 'codtable:list,codtable:info', '2', null, '1', '1' from dual; 
INSERT INTO sys_menu (menu_id,parent_id, name, url, perms, type, icon, order_num, plat)
    SELECT SEQ_MENU_ID.nextval, @parentId, '新增', null, 'codtable:save', '2', null, '2','1' from dual; 
INSERT INTO sys_menu (menu_id,parent_id, name, url, perms, type, icon, order_num, plat)
    SELECT SEQ_MENU_ID.nextval, @parentId, '修改', null, 'codtable:update', '2', null, '3','1' from dual; 
INSERT INTO sys_menu (menu_id,parent_id, name, url, perms, type, icon, order_num, plat)
    SELECT SEQ_MENU_ID.nextval, @parentId, '删除', null, 'codtable:delete', '2', null, '4','1' from dual; 

commit;


--mysql

-- 一级菜单
INSERT INTO sys_menu (parent_id, name, url, perms, type, icon, order_num, plat)
    VALUES ('0', '模块名', '', NULL, '', 'fa fa-laptop', '3','1');
commit;

set @pId = @@identity;
-- 菜单SQL
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, plat)
    VALUES (@pId, '代码生成表', 'code/codTable.html', NULL, '1', 'fa fa-laptop', '2', '1');

-- 按钮父菜单ID
set @parentId = @@identity;

-- 菜单对应按钮SQL
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, plat)
    SELECT @parentId, '查看', null, 'codtable:list,codtable:info', '2', null, '1', '1';
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, plat)
    SELECT @parentId, '新增', null, 'codtable:save', '2', null, '2', '1';
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, plat)
    SELECT @parentId, '修改', null, 'codtable:update', '2', null, '3', '1';
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, plat)
    SELECT @parentId, '删除', null, 'codtable:delete', '2', null, '4', '1';
    
